﻿<%@ Page Language="C#" MasterPageFile="~/Enterprise/Master/AdminMaster.Master" AutoEventWireup="true"
    CodeBehind="MessageAdd.aspx.cs" Inherits="HZ.DrugTrade.Web.Enterprise.MessageManage.MessageAdd"
    Title="发消息" ValidateRequest="false" %>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <script type="text/javascript" src="../../webeditor/tiny_mce/tiny_mce.js"></script>

    <script type="text/javascript" language="javascript">
        tinyMCE.init({
            // General options
            mode: "textareas",
            theme: "advanced",
            plugins: "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups",
            // Theme options
            theme_advanced_buttons1: "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontselect,fontsizeselect",
            theme_advanced_buttons2: "cut,copy,paste,pastetext,pasteword,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,code,|,forecolor,backcolor,|,hr,removeformat,visualaid,|,sub,sup",
            theme_advanced_buttons3: "",
            theme_advanced_toolbar_location: "top",
            theme_advanced_toolbar_align: "left",
            theme_advanced_resizing: true,
            relative_urls: false, //
            remove_script_host: false,//
            content_css: "Stylesheet.css",
            language: "zh"
        });

        function InsertToEditor(content) {
            tinyMCE.execCommand('mceInsertContent', true, content);
        }

        //将选择的收件人信息存入相应位置
        function insertCompanyInfo(companyInfo) {

            var varCompanyInfo = companyInfo.split('|');

            var companyNames = varCompanyInfo[0];
            var companyIDs = varCompanyInfo[1];
            var companyID = document.getElementById("ctl00_ContentPlaceHolder1_hfdRecivedPerson");
            var companyName = document.getElementById("ctl00_ContentPlaceHolder1_txtRecivedPerson");
            companyName.value = companyName.value + companyNames;
            companyID.value = companyID.value + companyIDs;


        }

        //清空收件人
        function txtclear() {
            document.getElementById("ctl00_ContentPlaceHolder1_hfdRecivedPerson").value = "";
            document.getElementById("ctl00_ContentPlaceHolder1_txtRecivedPerson").value = "";
            //            companyID.value="";
            //            companyName.value="";

        }

        //         //打开窗口
        //        function OpenWindow()
        //        {
        //           //获取dropdownlist控件
        //           var ddlType=document.getElementById("ctl00_ContentPlaceHolder1_ddlType");
        //           //获取项的索引
        //           var index=ddlType.selectedIndex;
        //           //选择项的值
        //           var value=ddlType.options[index].value;
        //           //打开窗口
        //           window.open("RecieverSelect.aspx?flag="+value,"selectReciever","width=600,height=400,resizable=0,scrollbars=0, status=0, toolbar=0, menubar=0'");
        //        }
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="tabnav">
        <ul>
            <li class="active"><a href="MessageAdd.aspx">新增消息</a></li>
            <li><a href="FeedBackAdd.aspx">新增反馈</a></li>
        </ul>
    </div>
    <div class="maincon">
        <table>
            <tr>
                <th style="width: 100px">
                    收件人：
                </th>
                <td>
                    <asp:TextBox ID="txtRecivedPerson" runat="server" Width="345px" CssClass="gray" ToolTip="收件人无法自己输入，请选择"></asp:TextBox>
                    <asp:HiddenField ID="hfdRecivedPerson" runat="server" />
                    <input id="btnSelectH" type="button" value="医疗机构" style="width:30px" class="btn" onclick="window.open('RecieverSelect.aspx?flag=1','selectReciever','width=300,height=420,resizable=1,scrollbars=1, status=0, toolbar=0, menubar=0');" />
                    <input id="btnSelectC" type="button" value="企业" style="width:30px" class="btn" onclick="window.open('RecieverSelect.aspx?flag=2','selectReciever','width=300,height=420,resizable=1,scrollbars=1, status=0, toolbar=0, menubar=0');" />
                    <input id="btnSelectM" type="button" value="中心机构" style="width:60px" class="btn" onclick="window.open('RecieverSelect.aspx?flag=3','selectReciever','width=300,height=400,resizable=1,scrollbars=1, status=0, toolbar=0, menubar=0');" />
                    <input id="btnClearReciver" type="button" value="清空" style="width:30px" onclick="txtclear()" class="btn" />
                </td>
            </tr>
            <tr>
                <th>
                    标题：
                </th>
                <td>
                    <asp:TextBox ID="txtTitle" runat="server" Width="428px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <th>
                    内容：
                </th>
                <td>

                    <FCKeditorV2:FCKeditor  ID="txtContent" runat="server" Height="500"></FCKeditorV2:FCKeditor>
                </td>
            </tr>
            <tr>
                <th>
                    发件人：
                </th>
                <td runat="server" id="tdSender">
                </td>
            </tr>
            <tr>
                <th>
                </th>
                <td>
                    <asp:CheckBox ID="cbxSaveToSendBox" Text="发送并保存到发件箱" runat="server" />
                </td>
            </tr>
        </table>
    </div>
    <div class="listctrl">
        <hz:HzButton ID="btnAdd" runat="server" Text="发  送" CssClass="btn" OnClick="btnAdd_Click" />
        &nbsp;
        <input type="reset" value="重  置" class="btn" />
    </div>
</asp:Content>
